<template>
    <div class="like">
        <audio :src="`${$publicPath}audio/Candy_Wind.mp3`"
               autoplay
               id="audio" loop></audio>
        <canvas id="canvas"></canvas>
        <div class="music">
            <div class="star"></div>
            <div class="iconfont"></div>
        </div>
    </div>
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
const { a } = require("~/static/js/liuxingyu.js");
// const Velocity:any = require('../../../public/static/js/velocity.min.js')
@Component
export default class Like extends Vue {
  text: string = ``;
  starArr: any[] = [];
  audio: any;
  mounted() {
    this.$nextTick(() => {
      a();
      const dom: any = this.$refs.music;
    });
  }
  activated() {
    this.audio = document.getElementById("audio");
    this.audio.load();
    this.audio.play();
  }
}
</script>
<style lang="scss" scoped>
svg {
  display: block;
  width: 100%;
}

rect {
  transform-origin: 0% 0%;
}
.like {
  padding: 0.35rem;
  height: 100%;
  background-color: rgb(63, 73, 126);
  #canvas {
    position: absolute;
    left: 0;
    top: 0;
  }
  .music {
    // background-color: red;
    .text {
      font-family: tielan;
      font-size: 30px;
    }
    .star {
      width: 3px;
      height: 3px;
      background-color: #fff;
      border-radius: 50%;
    }
  }
}
</style>
